//package com.koi.system.config.swagger;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.bind.annotation.RestController;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.ParameterBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.schema.ModelRef;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.service.Parameter;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * swagger2 配置API接口
// * @author 大猫
// * @date 2021/7/21 0:13
// * @return null
// */
//@Configuration
////@EnableSwagger2 // 启用swagger2
//public class SwaggerConfiguration {
//
//    @Value("${swagger.enable}") //是否开启swagger
//    private Boolean enable;
//
//    /**
//     * 在IOC容器里面创建可以对象可以扫描Controller里面的是否有Swagger相关的注解 如果，swagger会生成相关的文档
//     * @author 大猫
//     * @date 2021/7/21 0:15
//     * @return springfox.documentation.spring.web.plugins.Docket
//     */
//    @Bean
//    public Docket swaggerSpringMvcPlugin() {
///*        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
//                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
//                .build();*/
//
//        //添加head参数配置start
////        ParameterBuilder tokenPar = new ParameterBuilder();
////        List<Parameter> pars = new ArrayList<>();
////        tokenPar.name("candy").description("candy").modelRef(new ModelRef("string")).parameterType("header").required(enable).build();
////        pars.add(tokenPar.build());
//        //添加head参数配置end
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo())
//                .select()
//                //.apis(RequestHandlerSelectors.basePackage("com.candy.admin.controller"))
//                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
//                .paths(PathSelectors.any())
//                .build();
//                //.globalOperationParameters(pars);//注意这里
//    }
//
//    //访问路径：http://localhost:8222/doc.html
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder().description("好好学习，天天向上")
//                .contact(new Contact("大猫", "http://大猫", "1736306607@qq.com"))
//                .version("2.0")
//                .license("CANDY-VUE-MANAGER接口文档")
//                .build();
//    }
//
//}
